{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="log"></div>

<script src="{% static 'AdminLTE/bower_components/jquery/dist/jquery.min.js' %}"></script>
<script type="text/javascript">
    $(function () {
        let t = setInterval(function () {
            $.ajax({
                url: "{% url 'get_log_content' %}",
                type: 'POST',
                data: {"line": line},
                success: function (data) {
                    let response = data['log_content'];
                    if (response.indexOf("完成") === -1) {
                        $('#log').append('<p>' + response + '</p>');
                        window.scrollTo(0, document.body.scrollHeight);
                    } else {
                        clearInterval(t);
                    }
                },
                error: function () {
                    return false;
                }
            });
        }, 2000);
    });
</script>

</body>
</html>